package org.lanqiao.tjut.action;

import java.util.List;

import javax.annotation.Resource;

import org.lanqiao.tjut.bean.OperatorBean;
import org.lanqiao.tjut.service.IOperatorInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Kui
 *
 */
@Controller
public class OperatorInfoAction {
	// 注入Service
	@Resource
	private IOperatorInfoService opS;

	@RequestMapping("/addOperatorInfo")
	public String addOperatorInfo(OperatorBean opB) {
		// 输出管理员注册信息
		System.out.println("操作员添加：");
		System.out.println("操作员姓名：" + opB.getOpName());
		System.out.println("操作员密码:" + opB.getOpPsw());
		// 添加管理员信息
		opS.insert(opB);
		return "operatorsManager/operatorsInfoAddDetail";

	}
	@ResponseBody // 表示该方法是进行ajax响应处理
	@RequestMapping("/selectOperInfoByParams")
	public List<OperatorBean> selectOperInfoByParams(OperatorBean opB) {
		// 调用service进行数据库查询操作
		List<OperatorBean> lstOpS = opS.selectOperInfoByParams(opB);
		return lstOpS;
	}

}
